<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>lib Test</title>
<!-- lib js -->
<script type="text/javascript" src="../../src/FDLib/FDLib.js"></script>
<script type="text/javascript" src="../../src/FDLib/FDLib.util.js"></script>
<script type="text/javascript" src="../../src/FDLib/FDLib.ajax.js"></script>
<script type="text/javascript" src="../../src/FDLib/FDLib.browser.js"></script>
<script type="text/javascript" src="../../src/FDLib/FDLib.dom.js"></script>
<script type="text/javascript" src="../../src/FDLib/FDLib.event.js"></script>
<script type="text/javascript" src="../../src/FDLib/FDLib.string.js"></script>
<script type="text/javascript" src="../../src/FDLib/JString.js"></script>
<style type="text/css">
	.red {background-color: red;}
	.blue {background-color: blue;}
	.border1 {border: 3px solid black;}
	.border2 {border: 4px solid black;}
</style>
<script type="text/javascript">
// 新建一个Person类
FDLib.Class('Person',{
	init:function(opts) {
		console.log('Person inited...' + opts.age)
		this.gender = '男';
	}
	,setName:function(name) {
		this.name = name;
	}
	,getName:function() {
		return (this.getClassName() + ' name:' + this.name)
	}
	,getGender:function() {
		return this.gender;
	}
});

var p = new Person({age:10});
//p.init();
p.setName('Jim');
console.log(p.getName());
console.log('Person gender:' + p.getGender());
console.log('Person className:' + p.getClassName());

// 新建一个接口
FDLib.Interface('IPeople',['getName']);

// 新建一个类,继承Person类并且实现IPeople接口
FDLib.Class('Man',{
	init:function(opts) {
		console.log('Man inited...' + opts.age)
		this.gender = '女';
		this.setName('Tom');
	}
	// 重写父类方法
	,getGender:function() {
		var gender = this._super('getGender');// 调用父类方法
		return '{'+gender+'}';
	}
},Person).impl(IPeople);

var m = new Man({age:20});
console.log(m.getName());
console.log('Man gender:' + m.getGender());
console.log('Man className:' + m.getClassName());
console.log('m instanceof Person:' + (m instanceof Person));
console.log('m instanceof Man:' + (m instanceof Man));
</script>
</head>
<body>

</body>
</html>